Skip to content

Document an additional behavior of erb-right-trim#717

Closed
maxjacobson wants to merge 1 commit intomarcoroth:mainfrom
maxjacobson:mj/update-erb-right-trim-docs
Closed

Document an additional behavior of erb-right-trim#717
maxjacobson wants to merge 1 commit intomarcoroth:mainfrom
maxjacobson:mj/update-erb-right-trim-docs

Conversation

@maxjacobson
Copy link

erb-right-trim flagged a number of instances where we're using -%> when we should be using %>. In fixing them, I'd like to be able to link my team to the herb docs where they can read more about the change, but the page doesn't currently mention this behavior of this linter. Seems worth mentioning.

Incidentally, this is the tweak I wanted to make when I noticed #716 🙂

erb-right-trim flagged a number of instances where we're using `-%>`
when we should be using `%>`. In fixing them, I'd like to be able to
link my team to the herb docs where they can read more about the change,
but the page doesn't currently mention this behavior of this linter.
Seems worth mentioning.
@maxjacobson
Copy link
Author

I tried to put together a playground link showing the issues that I'm seeing locally, but surprisingly this is not flagged on the web 🤔

https://herb-tools.dev/playground?tab=diagnostics&diagnosticsFilter=linter#DwUgxABANg9gxgQygZwFwQBQEoIFoQB8AUEcAA4EASAplLBAO4wBOUAJsAPQVA

But locally we are seeing things like this:

[error] Right-trimming with -%> has no effect on non-output ERB tags. Use %> instead (erb-right-trim)

app/views/foo.html.erb:1:15

  →   1 │ <%# locals: () -%>
        │                ~~~
      2 │ <div class="usa-accordion">
      3 │   <h3 class="usa-accordion__heading">

Hm 🤔

@marcoroth
Copy link
Owner

marcoroth commented Oct 22, 2025

Hey @maxjacobson, sorry for the confusion.

The version you are running is v0.7.5, the playground is running on main.

The rule in v0.7.5 incorrectly flagged cases where -%> does have an effect on non-output ERB tags, which is why we removed that part of the rule in #645. But it hasn't been released yet, it's going to be part of v0.8.0.

@maxjacobson
Copy link
Author

ah! whoops. sounds like this one can safely be closed then right?

@maxjacobson maxjacobson deleted the mj/update-erb-right-trim-docs branch October 22, 2025 17:27
@marcoroth
Copy link
Owner

Yes, I think so. Sorry for the confusion. I hope I get to wrap up this big v0.8.0 release soon-ish here.

@maxjacobson
Copy link
Author

No worries, and no rush 🙂

@maxjacobson maxjacobson changed the title Document an additional behavior of erb-righ-trim Document an additional behavior of erb-right-trim Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants